﻿using RpcHelper.Config;
using SqlSugarHelper.Config;
using SqlSugarHelper.Repository;

namespace SqlSugarHelper
{
    public class SqlSugarService
    {
        public static void Init(IUnityContainer unity)
        {
            unity.RegisterSingle<IConfigCollect>(LocalConfig.Local);
            unity.RegisterSingle<ISugarConfig, Config.SugarConfig>();
            unity.Register<ITransactionService, Tran.LocalTransactionService>();
            unity.RegisterSingle<IDBConfig, DbConfigFactory>();
            unity.Register(typeof(IRepository<>),typeof(DefRepository<>));
            unity.Register<ISqlClientFactory, SqlClientFactory>();
        }
    }
}
